google.load("visualization", "1", {packages:["corechart"]});
google.setOnLoadCallback(barras);

function barras(div_) 
{
    var data = google.visualization.arrayToDataTable(); 
    data.addColumn('string', 'Opción'); 
    data.addColumn('number', 'Porcentaje'); 

    var options = 
    {
      title: 'Company Performance',
      vAxis: {title: 'Year',  titleTextStyle: {color: 'red'}}
    };

    var chart = new google.visualization.BarChart(document.getElementById(div_));
    chart.draw(data, options); 
}  

/*google.load("visualization", "1", {packages: ["corechart"]}); 
 * var respuestas = new Array(); 
 * var porcentajes = new Array();
 *  function drawChart(titulo,pres,ops) 
 *  { 
 *  var data = new google.visualization.DataTable(); 
 *  data.addColumn('string', 'Opción'); 
 *  data.addColumn('number', 'Porcentaje'); 
 *  for (var i = 0; i < ops.length; i++) 
 *  { data.addRow([ops[i], pres[i]]); }
 *  var options = { title: titulo, is3D: true }; 
 *  if(document.getElementById("divchart"))
 *  { 
 *  document.getElementById("subDiv").removeChild(document.getElementById("divchart")); 
 *  } 
 *  var divchart = document.createElement("div"); 
 *  divchart.setAttribute("id", "divchart"); 
 *  document.getElementById("subDiv").appendChild(divchart);
 *   var chart = new google.visualization.PieChart(document.getElementById("divchart")); 
 *   chart.draw(data, options); 
 *   } ;*/
